package com.zhuoyue.biz.core.command.cmd.common.faa.base;

/**
 * 场景子索引字典
 *
 * @author wjming
 */
public enum SceneEnum {
    //一路
    one("01", "0D"),
    //二路
    Two("02", "0E"),
    //三路
    Three("03", "0F");
    private String code;
    private String childOd;

    SceneEnum(String code, String command) {
        this.code = code;
        this.childOd = childOd;
    }

    public String getCode() {
        return code;
    }

    public String getChildOd() {
        return childOd;
    }


    /**
     * 根据Key得到枚举的Value
     * 普通for循环遍历，比较判断
     *
     * @param key
     * @return
     */
    public static String getSceneEnumCmd(String key) {
        SceneEnum[] alarmGrades = SceneEnum.values();
        for (int i = 0; i < alarmGrades.length; i++) {
            if (alarmGrades[i].getCode().equals(key)) {
                return alarmGrades[i].getChildOd();
            }
        }
        return "";
    }
}
